/*
 * Created: Author: Aléx Carvalho / Date: Mar 31, 2015
 * 
 * Changed: $Author: ac280593@gmail.com $ / $Date: 2015-06-11 01:28:43 -0300 (Thu, 11 Jun 2015) $
 */
package com.cpm.entities;

import com.cpm.entities.types.Family;
import com.cpm.entities.types.IndicatorDirectionType;
import com.cpm.entities.types.IndicatorModeType;
import com.cpm.entities.types.IndicatorPeriodicity;
import com.cpm.wrapper.Performance;
import com.cpm.wrapper.Position;
import com.cpm.wrapper.Weight;
import java.time.LocalDate;

public final class IndicatorBuilder {

    private Weight weight;
    private String units;
    private IndicatorDirectionType direction;
    private IndicatorModeType mode;
    private User responsible;
    private StrategicPlan strategicPlan;
    private String name;
    private Information information;
    private LocalDate dtStart;
    private LocalDate dtEnd;
    private Performance performace;
    private IndicatorPeriodicity periodicity;

    private Integer parentId;
    private Position position;
    private Family parentFamily;

    protected IndicatorBuilder() {
    }

    public IndicatorBuilder weight(Weight weight) {
        this.weight = weight;
        return this;
    }

    public IndicatorBuilder units(String units) {
        this.units = units;
        return this;
    }

    public IndicatorBuilder direction(IndicatorDirectionType direction) {
        this.direction = direction;
        return this;
    }

    public IndicatorBuilder mode(IndicatorModeType mode) {
        this.mode = mode;
        return this;
    }

    public IndicatorBuilder periodicity(IndicatorPeriodicity periodicity) {
        this.periodicity = periodicity;
        return this;
    }

    public IndicatorBuilder responsible(User responsible) {
        this.responsible = responsible;
        return this;
    }

    public IndicatorBuilder strategicPlan(StrategicPlan strategicPlan) {
        this.strategicPlan = strategicPlan;
        return this;
    }

    public IndicatorBuilder name(String name) {
        this.name = name;
        return this;
    }

    public IndicatorBuilder information(Information information) {
        this.information = information;
        return this;
    }

    public IndicatorBuilder dtStart(LocalDate dtStart) {
        this.dtStart = dtStart;
        return this;
    }

    public IndicatorBuilder dtEnd(LocalDate dtEnd) {
        this.dtEnd = dtEnd;
        return this;
    }

    public IndicatorBuilder parentId(Integer parentId) {
        this.parentId = parentId;
        return this;
    }

    public IndicatorBuilder position(Position position) {
        this.position = position;
        return this;
    }

    public IndicatorBuilder parentFamily(Family parentFamily) {
        this.parentFamily = parentFamily;
        return this;
    }

    public IndicatorBuilder parentFamily(Performance performace) {
        this.performace = performace;
        return this;
    }

    public Indicator build() {
        return new Indicator(parentId, parentFamily, weight, units, direction, periodicity, mode, responsible, strategicPlan,
                name, information, dtStart, dtEnd, position, performace);
    }
}
